<?php
/**
 * Bootstrap file. It starts the framework.
 * 
 * Copyright (c) 2006-2007, Julien PORTALIER
 *
 * Some parts are copyright (c) CakePHP,
 * @link http://cakephp.org/
 * 
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 * 
 * @copyright    Copyright (c) 2006-2007, Julien PORTALIER
 * @link         http://featherphp.google.com/
 * @license      http://www.opensource.org/licenses/mit-license.php The MIT License
 */

# paths
define('DS',       DIRECTORY_SEPARATOR);
define('WWW_ROOT', dirname(__FILE__).DS);
define('APP',      dirname(WWW_ROOT).DS);
define('ROOT',     dirname(APP).DS);
define('FEATHER',  ROOT.'feather2'.DS);

# base functions
require FEATHER.'basics.php';

# full URL prefix
$https = env('HTTPS');
define('PROTOCOL', 'http'.((isset($https) && $https == 'on') ? 's' : null).'://');
$httpHost = env('HTTP_HOST');
if (isset($httpHost))
	define('FULL_BASE_URL', PROTOCOL.$httpHost);
unset($https, $httpHost);

# feather's core
require APP.'config'.DS.'core.php';
require FEATHER.'libs'.DS.'base.php';
require FEATHER.'libs'.DS.'dispatcher.php';

# dispatching
Dispatcher::dispatch(isset($_GET['url']) ? $_GET['url'] : '/');
?>